<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<kd-warnings warnings="$ctrl.errors"
             class="kd-login-error"></kd-warnings>

<form name="$ctrl.form"
      ng-submit="$ctrl.login()"
      novalidate>
  <kd-content-card class="kd-login-card">
    <kd-title>
      [[Kubernetes Dashboard|Title shown on login page on login card]]
    </kd-title>
    <kd-content>
      <kd-login-options on-change="$ctrl.onOptionChange()">
        <kd-token-login ng-if="$ctrl.isAuthenticationModeEnabled($ctrl.supportedAuthenticationModes.TOKEN)"
                        title="[[Token|Token option label shown on login page]]"
                        desc="[[Every Service Account has a Secret with valid Bearer Token that can be used to log in to Dashboard. To find out more about how to configure and use Bearer Tokens, please refer to the <a href='https://kubernetes.io/docs/admin/authentication/'>Authentication</a> section.|]]"
      
                        on-update="$ctrl.onUpdate(loginSpec)"></kd-token-login>
        <kd-basic-login ng-if="$ctrl.isAuthenticationModeEnabled($ctrl.supportedAuthenticationModes.BASIC)"
                        title="[[Basic|Basic option label shown on login page]]"
                        on-update="$ctrl.onUpdate(loginSpec)"></kd-basic-login>
        <kd-kube-config-login title="[[Kubeconfig|Kubeconfig option label shown on login page]]"
                              desc="[[Please select the kubeconfig file that you have created to configure access to the cluster. To find out more about how to configure and use kubeconfig file, please refer to the <a href='https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/'>Configure Access to Multiple Clusters</a> section.|]]"
      
                              on-update="$ctrl.onUpdate(loginSpec)"></kd-kube-config-login>
      </kd-login-options>

      <md-button class="md-raised md-primary"
                 type="submit">
        [[Sign in|Text shown on the sign in button on login page]]
      </md-button>
      <md-button class="md-primary"
                 ng-click="$ctrl.skip()"
                 ng-if="$ctrl.isSkipButtonEnabled()">
        [[Skip|Text shown on skip button on login page]]
      </md-button>
    </kd-content>
  </kd-content-card>
</form>
